package com.mika.music.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface MusicLabelMapper {

    @Insert("insert into music_label(music_id, label_name) values(#{musicId}, #{labelName});")
    Integer addMusicLabel(Integer musicId, String labelName);

    @Delete("delete from music_label where music_id = #{musicId}")
    Integer deleteMusicLabelByMusicId(Integer musicId);

    @Select("select label_name from music_label where music_id = #{musicId}")
    List<String> getLabelByMusicId(Integer musicId);
}
